<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>04_运算符</title>
</head>
<body>
<script>
    console.log(3>10);
    console.log(3>'10');
    console.log("欢">"宇");
    console.log("欢".charCodeAt());
    console.log("宇".charCodeAt());

    // 除法算出是什么就是什么
    console.log(3/2);
    console.log(6/2);

    var a = 1;
    var b = true;
    // 松散比较运算符 只比较值，number(true)=1
    console.log(a==b);
    // 严格比较云运算符 先比较类型再比较值 number ≠ boolean
    console.log(a===b);

    console.log(Number(true),typeof Number(true));
    console.log(Number('3'),typeof Number('3'));
    // NaN(NOT A NUMBER) 不是一个数字 得不到数字结果
    console.log(Number('你好'),typeof Number('你好'));

    // Boolean()将参数转换为布尔值
    // 参数为下面五种为false  其余为true
    console.log(Boolean(0));
    console.log(Boolean(null));
    console.log(Boolean(undefined));
    console.log(Boolean(''));
    console.log(Boolean(NaN));
    console.log(Boolean('走下去'));

    let c = 0;
    console.log(c==0 ? 'yes' : 'no');
    // 0转换为false 为no
    console.log(c=0 ? 'yes' : 'no');



</script>
</body>
</html>